package com.edu.exam.enums.grading.correction;

/**
 * 审核状态枚举
 * 
 * 定义成绩修正审核的不同状态
 */
public enum AuditStatus {
    PENDING("Pending", "待审核"),
    IN_PROGRESS("InProgress", "审核中"),
    APPROVED("Approved", "审核通过"),
    REJECTED("Rejected", "审核拒绝"),
    RETURNED("Returned", "审核退回");

    private final String code;
    private final String description;

    AuditStatus(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static AuditStatus fromCode(String code) {
        for (AuditStatus status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return PENDING;
    }
}